<?php
require_once('mysql.php');

$name = $_GET['name'];
$description = $_GET['description'];
$user_id = $_GET['user_id'];

$name = addslashes($name);

$query = "insert into todo_list (name, description, owner_id) values ('$name', '$description', $user_id)";
mysql_query($query) or die(mysql_error());
$last_insert = mysql_insert_id();

$query = "insert into can_edit (user_id, list_id) values ($user_id, $last_insert)";
mysql_query($query);

echo $last_insert;
?>
